package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserTraceMapper;
import com.ruoyi.system.domain.UserTrace;
import com.ruoyi.system.service.IUserTraceService;

/**
 * 用户轨迹Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-02
 */
@Service
public class UserTraceServiceImpl implements IUserTraceService 
{
    @Autowired
    private UserTraceMapper userTraceMapper;

    /**
     * 查询用户轨迹
     * 
     * @param id 用户轨迹主键
     * @return 用户轨迹
     */
    @Override
    public UserTrace selectUserTraceById(Long id)
    {
        return userTraceMapper.selectUserTraceById(id);
    }

    /**
     * 查询用户轨迹列表
     * 
     * @param userTrace 用户轨迹
     * @return 用户轨迹
     */
    @Override
    public List<UserTrace> selectUserTraceList(UserTrace userTrace)
    {
        return userTraceMapper.selectUserTraceList(userTrace);
    }

    /**
     * 新增用户轨迹
     * 
     * @param userTrace 用户轨迹
     * @return 结果
     */
    @Override
    public int insertUserTrace(UserTrace userTrace)
    {
        userTrace.setCreateTime(DateUtils.getNowDate());
        return userTraceMapper.insertUserTrace(userTrace);
    }

    /**
     * 修改用户轨迹
     * 
     * @param userTrace 用户轨迹
     * @return 结果
     */
    @Override
    public int updateUserTrace(UserTrace userTrace)
    {
        userTrace.setUpdateTime(DateUtils.getNowDate());
        return userTraceMapper.updateUserTrace(userTrace);
    }

    /**
     * 批量删除用户轨迹
     * 
     * @param ids 需要删除的用户轨迹主键
     * @return 结果
     */
    @Override
    public int deleteUserTraceByIds(Long[] ids)
    {
        return userTraceMapper.deleteUserTraceByIds(ids);
    }

    /**
     * 删除用户轨迹信息
     * 
     * @param id 用户轨迹主键
     * @return 结果
     */
    @Override
    public int deleteUserTraceById(Long id)
    {
        return userTraceMapper.deleteUserTraceById(id);
    }
}
